<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>{eq name="ADMINTYPE" value="2"}加盟商{/eq}管理后台</title>
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    {include file="common:css"}
    <style rel="stylesheet" type="text/css">
        .pagination{float: right;}
        .pagination li{float: left;margin-right: 10px;cursor: pointer}
        .pagination .active{background-color: #0e90d2;color: white;padding: 2px;}
        .widget-body{padding-left: 0;}
        .am-u-sm-12 .am-cf{overflow-x:scroll}
        .am-u-sm-12 .am-cf::-webkit-scrollbar { width: 0 !important }
        .am-u-sm-12 .am-cf { -ms-overflow-style: none; }
        .am-u-sm-12 .am-cf { overflow: -moz-scrollbars-none; }
        .theme-white .tpl-header-logo{color: #000}
        .theme-black .tpl-header-logo{color: #a29a9a}
        .left-sidebar{height: 100vh;}

        .theme-black .layui-layer-content{background: #4b5357;color: #FFFFFF}
        .theme-black .layui-layer-btn{background:#d0d0d0;}
        .theme-black .layui-layer-title{background:#d0d0d0;}
        @media screen and (max-width: 1024px) {
            .left-sidebar {
                left: -240px;
            }
        }
        @media screen and (min-width: 1024px) {
            .left-sidebar {
                left: 0px;
            }
        }
    </style>
</head>
<!--class="theme-white"-->
<body data-type="index" class="theme-white">
<div class="am-g tpl-g">
    <!-- 头部 -->
    <header>
        <!-- logo -->
        <div class="am-fl tpl-header-logo" style="text-align: center;line-height: 57px;font-size: 28px;">
            管理后台
        </div>
        <div class="tpl-header-fluid">
            <div class="am-fl tpl-header-switch-button am-icon-list">
                    <span>

                </span>
            </div>
            <!-- 搜索 -->
            <!--<div class="am-fl tpl-header-search">
                <form class="tpl-header-search-form" action="javascript:;">
                    <button class="tpl-header-search-btn am-icon-search"></button>
                    <input class="tpl-header-search-box" type="text" placeholder="搜索内容...">
                </form>
            </div>-->
            <!-- 其它功能-->
            <div class="am-fr tpl-header-navbar">
                <ul>
                    <!-- 欢迎语 -->
                    <li class="am-text-sm tpl-header-navbar-welcome">
                        <a href="javascript:;">欢迎你, {$admin_info.nickname} </a>
                    </li>
                    <!-- 新邮件 -->
                    <li class="am-dropdown tpl-dropdown" data-am-dropdown>
                        <a href="javascript:;" class="am-dropdown-toggle tpl-dropdown-toggle" data-am-dropdown-toggle>
                            <i class="am-icon-gear"></i>
                        </a>
                        <!-- 弹出列表 -->
                        <ul class="am-dropdown-content tpl-dropdown-content">

                            <li class="tpl-dropdown-menu-notifications">
                                <a href="{:url('/admin/auth/edit_pwd')}" class="tpl-dropdown-menu-notifications-item am-cf">
                                    <div class="tpl-dropdown-menu-notifications-title">
                                        <i class="am-icon-pencil"></i>
                                        <span> 登录密码修改</span>
                                    </div>
                                </a>
                            </li>
                            <li class="tpl-dropdown-menu-notifications">
                                <a href="#" id="tuichu" class="tpl-dropdown-menu-notifications-item am-cf">
                                    <div class="tpl-dropdown-menu-notifications-title">
                                        <i class="am-icon-sign-out"></i>
                                        <span>退出</span>
                                    </div>
                                </a>
                            </li>
                        </ul>
                    </li>
                    <li class="am-text-sm">
                        <a href="#" onclick="window.location.reload()">
                            <span class="am-icon-refresh"></span> 刷新
                        </a>
                    </li>
                </ul>
            </div>
        </div>

    </header>
    <!-- 风格切换 -->
   <!-- <div class="tpl-skiner">
        <div class="tpl-skiner-toggle am-icon-cog">
        </div>
        <div class="tpl-skiner-content">
            <div class="tpl-skiner-content-title">
                选择主题
            </div>
            <div class="tpl-skiner-content-bar">
                <span class="skiner-color skiner-white" data-color="theme-white"></span>
                <span class="skiner-color skiner-black" data-color="theme-black"></span>
            </div>
        </div>
    </div>-->
    <!-- 侧边导航栏 -->
    <div class="left-sidebar" >
        <!-- 菜单 -->
        <ul class="sidebar-nav">
            {foreach $menu as $key=>$val}
            <li class="sidebar-nav-link">
                <a  href="{empty name="$val['son']"}{:url($val.router_url)} {else /}javascript:;{/empty}" class="sidebar-nav-sub-title {php} if($uri == $val['router_url']){ {/php} sub-active {php}}{/php}">
                <i class="{$val['icon']} sidebar-nav-link-logo"></i> {$val.name}
                {notempty name="$val['son']"}
                <span class="am-icon-chevron-down am-fr am-margin-right-sm sidebar-nav-sub-ico"></span>
                {/notempty}
                </a>
                {notempty name="$val['son']"}
                    <ul class="sidebar-nav sidebar-nav-sub"
                        {php}
                        if(strpos(json_encode($val['son'],JSON_UNESCAPED_SLASHES),$uri)){
                        {/php}style='display:block'  {php}
                        }else{
                          if(strpos(json_encode($val['son'],JSON_UNESCAPED_SLASHES),'/'.strtolower(request()->controller()).'/')){
                            {/php}style='display:block'  {php}
                        }
                        }
                        {/php}>
                        {foreach $val['son'] as $v}
                            <li class="sidebar-nav-link">
                                <a href="{:url($v.router_url)}" {php} if($uri == $v['router_url']){ {/php} class="sub-active"  {php}}{/php}>
                                <span class="am-icon-angle-right sidebar-nav-link-logo"></span>
                                {$v.name}
                                </a>
                            </li>
                        {/foreach}
                    </ul>
                {/notempty}
            </li>
        {/foreach}
        </ul>

    </div>
    <!-- 内容区域 -->
    <div class="tpl-content-wrapper" id="widgets" style="" >
        <div style="overflow: hidden;width: 100%;">
            <div class="row-content am-cf" style="width: 100%;overflow-y:scroll">
                {block name="content"}{/block}
            </div>
        </div>

    </div>
</div>

{include file="common:js" /}
{block name="script"}{/block}
<script type="text/javascript">
    $('.sub-active').parents('ul').prev('a').addClass('active');
    function openUrl(url,title) {
        title = title||"编辑"
        var index = layer.open({
            type: 2,
            title:title,
            content: [url, 'yes'],
            area: ['60%','80%'],
            maxmin: true
        });
    }
    $('#tuichu').click(function () {
        var index =  layer.confirm('确定要退出登录？',function () {
            window.location.href = "{:url('/login/quit')}";
        });

    })
    function rms(dom,url,id) {
        var index =  layer.confirm('确定要删除这条信息？',function () {
            $.get(url,{id:id},function (res) {
                layer.close(index)
                if(res.code!=0){
                    layer.alert(res.msg,{icon:5})
                }else{
                    $(dom).parents('tr').remove()
                }
            })
        })
    }
    layer.config({
        extend: 'extend/layer.ext.js'
    });
    function shenhe(id,url) {
        var htm = '<div class="widget-body am-fr"> <div class="am-u-sm-12 am-u-md-12 am-u-lg-12" id="viewer"> <table width="100%" class="am-table am-table-compact am-table-bordered am-table-radius am-table-striped tpl-table-black " id="example-r"> <tbody>';
        var ids = '#v_'+id;
        $('thead').find('th').each(function (index) {
            var value = $.trim($(ids).find('td').get(index).innerHTML);
            if(this.innerHTML =='操作')return;
            htm+='<tr class="gradeeC"><td>'+$.trim(this.innerHTML)+'</td><td>'+value+'</td></tr>';
        })
        htm += '</tbody></table>';
        window.layer.open({
            type: 1,
            content:htm,
            title:"详情",
            offset:"rt",btn:['通过','不通过','关闭'],btn1:function () {
                layer.prompt({formType: 2,title: '通过原因',}, function(value, index, elem){
                    this_posts(url,id,value,1)
                });
            },btn2:function () {
                layer.prompt({formType: 2,title: '失败原因',}, function(value, index, elem){
                    this_posts(url,id,value,2)
                });
            }
        })
    }
    function this_posts(url,id,admin_remarks,status) {
        $.post(url,{id,admin_remarks:admin_remarks,status:status},function (res) {
            if(res.code ==0){
                layer.alert("审核成功！",function () {
                    layer.closeAll();
                    window.location.reload();
                });
            }else{
                layer.alert(res.msg);
            }
        },'json')
    }
</script>
</body>
</html>



